#pragma once

#include <QGroupBox>

class QLineEdit;
class QRadioButton;
class ImageMappingManager;
class ImageDataProvider;
class ProjectPanel  : public QGroupBox
{
	Q_OBJECT

public:
	ProjectPanel(QWidget *parent=nullptr);
	~ProjectPanel();

private slots:
    void onLoadSettings();
    void onSaveSettings();

    void onLoadAndScanDirectory();

    void onMappingUpdated();
    void onScanCompleted();
    void onParametersChanged();

    void onImagesRenamed(bool success,const QString& message);

private:
	void initComponents();
	void setupUi();

    void loadDictionary(const QString& dic);
    void generateFileMapping();

    int imageDisplayMode;
    QString selectSettingPath();
    QHash<QString,QLineEdit*> valuesCollection;
    QHash<QString,QRadioButton*> modeCollection;

    ImageMappingManager* mappingManager;
    ImageDataProvider* dataProvider;


    const QString fovRowCount = "fovRowCount";
    const QString fovColCount = "fovColCount";
    const QString fovCount = "fovCount";

    const QString fixtureRowCount = "fixtureRowCount";
    const QString fixtureColCount = "fixtureColCount";
    const QString fixtureCount = "fixtureCount";

    const QString displayMode = "displayMode";
    const QString singleImage = "singleImage";
    const QString multipleImage = "multipleImage";

    const QString currentFolder = "currentFolder";
};

